package org.Vancl.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.Vancl.Dao.ShoppingCarDao;
import org.Vancl.Dao.ShoppingColorDao;
import org.Vancl.Dao.ImpI.ShoppingCarDaoImpI;
import org.Vancl.Dao.ImpI.ShoppingColorDaoImpI;

@WebServlet(urlPatterns="/deletefindshopping.shtml")
public class deletefindshopping extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setContentType("text/html; charset=utf-8");
		String id=req.getParameter("id");
		String from=req.getParameter("from");
		ShoppingColorDao scd=new ShoppingColorDaoImpI();
		int result=scd.delete(Integer.parseInt(id));
		PrintWriter out=resp.getWriter();
		if (result>0) {
			out.print(true);
		}else {
			out.print(false);
		}
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doGet(req, resp);
	}
}
